package com.ourteam.product.api;

import com.ourteam.frame.web.AbstractSearchModel;
import com.ourteam.product.ui.dao.ProductUIPageParamDAOQueryBean;
import com.ourteam.product.ui.domain.ProductUIPageParamBean;

public class ProductUIPageParamSearchModel extends AbstractSearchModel<ProductUIPageParamDAOQueryBean> {

	private long pageId;

	public long getPageId() {
		return pageId;
	}

	public void setPageId(long pageId) {
		this.pageId = pageId;
	}

	@Override
	public String getMappedDAOField(String aProperty) {
		return ProductUIPageParamBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(ProductUIPageParamDAOQueryBean queryBean) throws Exception {

		ProductUIPageParamDAOQueryBean.Criteria criteria = queryBean.createCriteria();

		if (this.pageId != 0) {
			criteria.andPageIdEqualTo(pageId);
		}

	}

}
